<template>
  <div class="boxshow" v-if="partListCon">
    <!-- {{ partListCon }} -->
    <div class="new_phone_shop_body">
      <modueltitle :info="partListCon"></modueltitle>
      <div class="new-merchant-box-content">
        <div class="merchant_shop">
          <div class="merchant_shop_box">
            <div
              class="merchant_shop_item"
              v-for="(item, i) in partListCon.banner"
              :key="i"
            >
              <div class="merchant_shop_title">
                <p>
                  {{ item.shop_title || '---' }}
                  <span>推荐</span>
                </p>
                <i class="el-icon-position"></i>
              </div>
              <div class="merchant_shop_rate">
                <div class="merchant_shop_left">
                  <p>
                    评级:
                    <el-rate :value="5" disabled text-color="#ff9900"></el-rate>
                  </p>
                  <p>
                    商品:
                    <span>35</span>件
                  </p>
                </div>
                <p>距离:35KM</p>
              </div>
              <p><span>推荐</span>满22减20,满22减20</p>
              <div class="merchant_shop_goods">
                <div
                  class="merchant_shop_goods_item"
                  v-for="(shop, k) in item.product_lists"
                  :key="k"
                >
                  <img :src="$fnc.getImgUrl(shop.piclink)" alt />
                  <p>{{ shop.title }}</p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
import modueltitle from '@/components/page/module/module_center/module_title_show'
export default {
  data() {
    return {}
  },
  components: {
    modueltitle
  },
  props: {
    index: {
      type: Number,
      default: -1
    }
  },
  computed: {
    ...mapState({
      active: state => state.modulePage.active,
      bannerNowIndex: state => state.modulePage.bannerNowIndex || 0,
      allbanner: state => state.modulePage.allbanner,
      partListCon() {
        if (this.index >= 0) {
          return this.allbanner[this.index]
        } else {
          return {}
        }
      }
    })
  },
  created() {},
  mounted() {},
  methods: {},
  filters: {
    toFix(val) {
      return parseFloat(val).toFixed(2)
    }
  }
}
</script>

<style scoped lang="less">
.boxshow {
  background-color: #ffffff;
}
.new-merchant-box-content {
  width: 94%;
  margin: 0 auto;
}
.merchant_shop_box {
  > div:not(:first-child) {
    border-top: 1px solid #f2f2f2;
    padding-top: 12px;
  }
}
.merchant_shop_item {
  background-color: #ffffff;
  margin: 0px 0px 15px;
}
.merchant_shop_title {
  height: 30px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
}
.merchant_shop_title > p {
  font-size: 16px;
  color: #000000;
  font-weight: bold;
}
.merchant_shop_title > p span {
  background-color: #fab81c;
  font-size: 14px;
  color: #000000;
  border-radius: 5px;
  padding: 1px 5px;
  margin-left: 10px;
}

.merchant_shop_rate {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
}
.merchant_shop_left {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
}
.merchant_shop_left > p {
  display: flex;
  font-size: 12px;
  color: #999999;
}
.merchant_shop_left > p span {
  font-size: 12px;
  color: #ff9900;
  padding-left: 5px;
}
.merchant_shop_rate > p {
  font-size: 12px;
  color: #999999;
}
.merchant_shop_item > p {
  width: 100%;
  font-size: 12px;
  color: #000000;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.merchant_shop_item > p > span {
  background-color: #f04e43;
  font-size: 14px;
  color: #ffffff;
  border-radius: 5px;
  padding: 1px 5px;
  margin-right: 5px;
}
.merchant_shop_goods {
  width: 100%;
  margin-top: 10px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
}
.merchant_shop_goods_item {
  width: 31%;
  margin-right: 12px;
  padding-bottom: 17px;
}
.merchant_shop_goods_item img {
  width: 100%;

  border-radius: 10px;
}
.merchant_shop_goods_item p {
  width: 100%;
  color: #444;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phone_shop_body {
  background: #fff;
}
.shops-box-bg {
  position: absolute;
  top: 0px;
  width: 100%;
  height: 130px;
  background: linear-gradient(to bottom, #ffca00 60%, #f4f4f4);
}
</style>
